﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using AnimationEditor.Document;

namespace AnimationEditor.Forms
{
    public class FrameViewControl : PictureBox
    {
        #region Properties

        public Frame Frame { get; set; }

        public float ScaleFactor { get; set; }

        #endregion

        #region Constructors

        public FrameViewControl()
        {
            ScaleFactor = 1f;
        }

        #endregion

        protected override void OnPaint(PaintEventArgs pe)
        {
            if (Frame != null)
            {
                ImageLocation = Frame.Texture;
            }
            pe.Graphics.PixelOffsetMode = System.Drawing.Drawing2D.PixelOffsetMode.Half;
            pe.Graphics.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.NearestNeighbor;
            pe.Graphics.ScaleTransform(ScaleFactor, ScaleFactor);
            base.OnPaint(pe);
        }

    }
}
